package com.zmn.plat.common.dictionary;

/**
 * 渠道-工单照片类型枚举
 *
 * @author linfeng
 * @since 2020/09/16 14:47:16
 */
public enum ChannelWorkOrderPictureTypeEnum {

    /**
     * values
     */
    AZHJ(1, "安装环境照片"),
    WXHJ(10, "维修环境照片"),
    JQTXM(2, "机器条形码"),
    ZJTSZ(3, "整机调试照"),
    FHWL(4, "返还物流照片"),
    XJ(5, "新旧照片"),
    GZ(6, "故障照片"),
    HP(7, "好评照"),
    XJCJ(8, "新机拆机照"),
    QRS(9, "确认书"),
    MPZ(11, "名牌照"),
    SGQ(12, "施工前照片"),
    WGH(13, "完工后照片"),
    XXZ(14, "形象照"),
    ZBZ(15, "装备照"),
    THZ(16, "贴花照");

    /**
     * 安装环境照片
     */
    public static final int CONSTS_AZHJ = 1;
    /**
     * 维修环境照片
     */
    public static final int CONSTS_WXHJ = 10;
    /**
     * 机器条形码
     */
    public static final int CONSTS_JQTXM = 2;
    /**
     * 整机调试照
     */
    public static final int CONSTS_ZJTSZ = 3;
    /**
     * 返还物流照片
     */
    public static final int CONSTS_FHWL = 4;
    /**
     * 新旧照片
     */
    public static final int CONSTS_XJ = 5;
    /**
     * 故障照片
     */
    public static final int CONSTS_GZ = 6;
    /**
     * 好评照
     */
    public static final int CONSTS_HP = 7;
    /**
     * 新机拆机照
     */
    public static final int CONSTS_XJCJ = 8;
    /**
     * 确认书
     */
    public static final int CONSTS_QRS = 9;
    /**
     * 名牌照
     */
    public static final int CONSTS_MPZ = 11;
    /**
     * 名牌照
     */
    public static final int CONSTS_SGQ = 12;
    /**
     * 名牌照
     */
    public static final int CONSTS_WGH = 13;
    /**
     * 形象照
     */
    public static final int CONSTS_XXZ = 14;
    /**
     * 装备照片
     */
    public static final int CONSTS_ZBZ = 15;
    /**
     * 贴花照
     */
    public static final int CONSTS_THZ = 16;

    private Integer code;
    private String name;

    ChannelWorkOrderPictureTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ChannelWorkOrderPictureTypeEnum of(Integer code) {
        if (code == null) {
            return null;
        }
        switch (code) {
            case 1:
                return AZHJ;
            case 2:
                return JQTXM;
            case 3:
                return ZJTSZ;
            case 4:
                return FHWL;
            case 5:
                return XJ;
            case 6:
                return GZ;
            case 7:
                return HP;
            case 8:
                return XJCJ;
            case 9:
                return QRS;
            case 10:
                return WXHJ;
            case 11:
                return MPZ;
            case 12:
                return SGQ;
            case 13:
                return WGH;
            case 14:
                return XXZ;
            case 15:
                return ZBZ;
            case 16:
                return THZ;
            default:
                return AZHJ;
        }
    }

    public static String getName(Integer code) {
        ChannelWorkOrderPictureTypeEnum of = of(code);
        return of == null ? null : of.getName();
    }

    public static ChannelWorkOrderPictureTypeEnum[] list() {
        return new ChannelWorkOrderPictureTypeEnum[] {AZHJ, WXHJ, JQTXM, ZJTSZ, FHWL, XJ, GZ, HP, XJCJ, QRS, MPZ, XXZ, ZBZ, THZ};
    }
}
